package org.iabako.shared.querydefinition.columndefinition;

import org.iabako.client.tools.Messages;
import org.iabako.shared.querydefinition.dto.QueryResultValueType;

import java.io.Serializable;

/**
 * Created by jose on 05/09/14.
 */
public enum PastInstallmentColumnEnum implements ColumnDefinition, Serializable {
    client("client.name", "result_table_past_installment_client", "columnMplus columnleftalign smalltable", null, null, null, QueryResultValueType.STRING, 8000, false),
    productsServices("sale.productsServicesAsString", "result_table_past_installment_product_service", "columnMplus columnleftalign smalltable", null, null, null, QueryResultValueType.STRING, 6000, false),
    date("installment.date", "result_table_past_installment_date", "columnS smalltable", null, null, null, QueryResultValueType.DATE, 3000, false),
    amount("installment.amount", "result_table_past_installment_amount", "columnS columnrightalign smalltable", null, null, null, QueryResultValueType.DOUBLE, 4000, false),
    comment("installment.comment", "result_table_past_installment_comment", "columndeleteaction columncenteralign", "commenticon", "commenticonempty", "installment_no_comment", QueryResultValueType.ICON, 4000, false),

    //To show
    status(null, "installment_status", "columnSminus columncenteralign", null, null, null, QueryResultValueType.ENUM, 4000, false),

    //To filter
    clientId("client.id", "left outer join sale.client client", null, null, null, null, null, 0, false),
    serviceId("productsServices.service.id", "join sale.productsServices productsServices", null, null, null, null, null, 0, false),

    //To show in Excel export
    clientNumber("client.number", "result_table_past_installment_client_number", null, null, null, null, QueryResultValueType.STRING, 3000, true),

    //default filter with user session
    pastInstallmentEnterprise("sale.enterprise", null, null, null, null, null, null, 0, false);

    private String hqlDefinition;
    private String labelKey;
    private String className;
    private String iconClassName;
    private String iconClassNameEmpty;
    private String textEmpty;
    private int excelColumnWidth;
    private QueryResultValueType queryResultValueType;
    private boolean onlyInExcelExport;

    PastInstallmentColumnEnum(String hqlDefinition, String labelKey, String className, String iconClassName,
                              String iconClassNameEmpty, String textEmpty,
                              QueryResultValueType queryResultValueType, int excelColumnWidth, boolean onlyInExcelExport) {
        this.hqlDefinition = hqlDefinition;
        this.labelKey = labelKey;
        this.className = className;
        this.iconClassName = iconClassName;
        this.iconClassNameEmpty = iconClassNameEmpty;
        this.textEmpty = textEmpty;
        this.queryResultValueType = queryResultValueType;
        this.excelColumnWidth = excelColumnWidth;
        this.onlyInExcelExport = onlyInExcelExport;
    }

    public String getHqlDefinition() {
        return hqlDefinition;
    }

    public String getHqlJoin() {
        return null;
    }


    public String getLabel() {
        return Messages.getLabel(labelKey);
    }

    public String getLabelKey() {
        return labelKey;
    }

    public QueryResultValueType getQueryResultValueType() {
        return queryResultValueType;
    }

    public String getClassName() {
        return className;
    }

    public String getIconClassName() {
        return iconClassName;
    }

    public int getExcelColumnWidth() {
        return excelColumnWidth;
    }

    public boolean isOnlyInExcelExport() {
        return onlyInExcelExport;
    }

    public String getIconClassNameEmpty() {
        return iconClassNameEmpty;
    }

    public String getTextEmpty() {
        return textEmpty;
    }

}
